class_name CardInventory
extends Control

@export var card_container: PackedScene

@onready var grid_container: GridContainer = %GridContainer
@onready var marker_2d: Marker2D = %Marker2D
@onready var card: Card = $H/CardView/VBoxContainer/CardPosition/Marker2D/Card

func open(inventory: Inventory) -> void:
	show()
	
	for child in grid_container.get_children():
		child.queue_free()
	
	for card_data in inventory.get_cards():
		var solt = card_container.instantiate()
		grid_container.add_child(solt)
		#print(Game.inventory.get_cards())
		solt.display(card_data)

func close() -> void:
	card.hide()
	hide()
